﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.Xml;
using System.Xml.Schema;



namespace Common
{
    [Serializable]
    public class PlainText : ISerializable
    {
        private String text;
        private Height height;
        public static int MessageNo = 0;

        public PlainText()
        {
        }

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("text", text);
            info.AddValue("height", height, height.GetType());
        }

        public PlainText(SerializationInfo info, StreamingContext context)
        {
            text = (String)info.GetValue("text", typeof(String));
            height = (Height)info.GetValue("height", typeof(Height));
        }

        public override String ToString()
        {
            return this.text +", " + this.height.ToString();
        }

        public PlainText(String text)
        {
            this.text = text;
            this.height = new Height(MessageNo++);
        }
    }
}
